package Serverlet;

import java.sql.SQLException;
import java.util.Map;

import com.alibaba.fastjson.JSONArray;
import com.google.gson.Gson;

import net.sf.json.JSONObject;
import tools.Lolita;

public class CommoServlet {
	public  String listCommo(String request) {
        
        Gson gson=new Gson();
        Map map = gson.fromJson(request, Map.class);


        String type=(String) map.get("type");

        JSONArray jsarr=new JSONArray();
        try {
        	jsarr=new Lolita().GetLolita("commodity",type,"type");
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        String str = gson.toJson(jsarr);
       
        return str;
	}
}
